<%- include('../../public/header.html')%>

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
<!-- <link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" /> -->
<link rel="stylesheet" type="text/css" href="https://cdn.bootcdn.net/ajax/libs/froala-editor/4.0.3/css/froala_editor.pkgd.min.css">

<script src="https://cdn.bootcdn.net/ajax/libs/jquery/2.2.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
<!-- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script> -->
<script type="text/javascript"  src="https://cdn.bootcdn.net/ajax/libs/froala-editor/4.0.3/js/froala_editor.pkgd.min.js"></script>
<script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/froala-editor/4.0.3/js/languages/zh_cn.js"></script>

<!-- Initialize the editor. -->

<div>增加文章</div>
<div class="tab">
    <!-- Nav tabs -->
    <div class="tab-c">
      <form action="/admin/article/doadd" method="post" enctype="multipart/form-data">
    <ul class="nav nav-tabs" role="tablist">
      <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">基本设置</a></li>
      <li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">内容详情</a></li>
      <li role="presentation"><a href="#messages" aria-controls="messages" role="tab" data-toggle="tab">seo设置</a></li>
    </ul>
  
    <!-- Tab panes -->
    <div class="tab-content">
      <div role="tabpanel" class="tab-pane active" id="home">
        <ul>
          <li>
            <span>所属分类：</span>
            <select name="cid" >
              <%for(var i = 0;i<catelist.length;i++){%>
                <option value="<%= catelist[i]._id%>"><%= catelist[i].title%></option>
                <%for(var j = 0;j<catelist[i].items.length;j++){%>
                  <option value="<%=catelist[i].items[j]._id%>">　　<%=catelist[i].items[j].title%></option>
                  <%}%>
                <%}%>
            </select>
          </li>
          <li>
            <span>内容标题：</span>
            <input type="text" name="title">
          </li>
          <li>
            <span>封面图：</span>
            <input type="file" name="article_img">
          </li>
          <li>
            <span>作者：</span>
            <input type="text" name="author">
          </li>
          <li>
            <span>排序：</span>
            <input type="text" name="sort">
          </li>
          <li>
            <span>状态：</span>
            <label for="x">显示</label>
            <input type="radio" id="x" name="status" value="1">
            <label for="nx">隐藏</label>
            <input type="radio" id="nx" name="status" value="0">
          </li>
          <li>
            <span>加入推荐：</span>
            <input type="checkbox" name="is_best" value=1>精品
            <input type="checkbox" name="is_hot" value=2>热门
          </li>
          <li>
            <button type="submit">提交</button>
          </li>
        </ul>
      </div>
      <div role="tabpanel" class="tab-pane" id="profile">
        <textarea name="content" id="content" cols="30" rows="10"></textarea>
      </div>
      <div role="tabpanel" class="tab-pane" id="messages">
        <ul>
          <li>
            <span>关键词：</span>
            <input type="text" name="keywords">
          </li>
          <li>
            <span>seo描述：</span>
            <textarea name="description" id="" cols="30" rows="10">
           
            </textarea>
          </li>
        </ul>
      </div>

    </div>
  </form>
</div>
  </div>
  <script>
new FroalaEditor('#content', {
      height: 300,
      language: 'zh_cn',
      imageUploadURL: '/admin/article/doUploadImage'
});
  </script>
</body>
</html>